package com.htz.agency.controller;

import com.htz.agency.pojo.Order;
import com.htz.agency.service.OrderService;
import com.htz.agency.util.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author tang
 * @date 2025年06月28日 21:12
 */
@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {
    @Autowired
    private OrderService userService;

    @GetMapping("/add")
    public Result  add(@RequestBody Order order){
        log.info("添加订单:{}", order);
        userService.add(order);
        return Result.ok ("添加成功");
    }

}
